package org.spring.springboot.base;

import java.io.Writer;

import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.core.util.QuickWriter;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
import com.thoughtworks.xstream.io.xml.PrettyPrintWriter;
import com.thoughtworks.xstream.io.xml.XppDriver;
import org.spring.springboot.pojo.req.ArrangementInfoParam;
import org.spring.springboot.pojo.req.DepartmentParam;
import org.spring.springboot.pojo.resp.ArrangementInfo;
import org.spring.springboot.pojo.resp.Department;
import org.spring.springboot.tools.KeySecretUtil;


public class AppConstant {

	//web�����ַ
	public final static String SERVER_URL = "http://221.7.82.75:14941/ExternalServices/ZL_InformationService.asmx/";
	
	
	//ģ������-------------------------------------------------
	/**
	 * �Һ�
	 */
	public final static String OutPatient = "OutPatient";
	//��ȡ�Һſ���
	public final static String Register_Depart_Query = "Register.Depart.Query";
	//��ȡ��Դ��Ϣ
	public final static String Register_SignalSource_Query = "Register.SignalSource.Query";
	
	
	
	
	/**
	 * ����ģ��
	 */
	public final static String UserManager = "Custom";
	//��ȡ��Դ��Ϣ
	public final static String BindCard_UserInfoByCardNO_Query = "BindCard.UserInfoByCardNO.Query";
	//�²��˵Ǽ�
	public final static String BindCard_CreateUser_Modify = "BindCard.CreateUser.Modify";
	
	public final static String BindCard_UserInfoByRegNO_Query ="BindCard.UserInfoByRegNO.Query";
	public final static String Register_Confirm_Modify ="Register.Confirm.Modify";
	
	/**
	 * ������Ϣģ��
	 */
	public final static String Information = "Information";
	//3.7.1.5.	��ȡ������ʽ�ļ���ַ
	public final static String Basic_ReportXSLT_Query = "Basic.ReportXSLT.Query";
	//3.7.2.3	��ȡ��Ժ�����б�
	public final static String Business_LeaveHosPatient_Query = "Business.LeaveHosPatient.Query";
	
	public final static String Register_Lock_Modify = "Register.Lock.Modify";
	
	public final static String Register_UnLock_Modify = "Register.UnLock.Modify";
	
	
	
	/**
	 * ��Կ��token
	 */
	public final static  String keySecret = "38C9F0B51E038214";
	public final static  String token = KeySecretUtil.Encrypt("360D9166C1F9578805BE677148C0F898",AppConstant.keySecret);
	
	
	 /** 
     * ��չxstream��ʹ��֧��CDATA��  ȫ��
     *  
     */  
    public static XStream xstreamCDATA= new XStream(new XppDriver() {  
        public HierarchicalStreamWriter createWriter(Writer out) {  
        	
        	xstreamCDATA.processAnnotations(DepartmentParam.class);
        	xstreamCDATA.processAnnotations(Department.class);
        	xstreamCDATA.processAnnotations(Department.Ks.class);
        	xstreamCDATA.processAnnotations(ArrangementInfoParam.class);
        	xstreamCDATA.processAnnotations(ArrangementInfo.class);
            return new PrettyPrintWriter(out) {  
                // ������xml�ڵ��ת��������CDATA���  
                boolean cdata = true;  
                protected void writeText(QuickWriter writer, String text) {  
                    if (cdata) {  
                        writer.write("<![CDATA[");  
                        writer.write(text);  
                        writer.write("]]>");  
                    } else {  
                        writer.write(text);  
                    }  
                }  
            };  
        }  
    }); 
    
    
    /** 
     * ��ͨxstream
     *  
     */  
    public static XStream xstream = new XStream(); 
}
